/**
 * Copyright (C), 2020-2021 by colley.ma
 * File Name: EventInfo.java
 * Encoding: UTF-8
 * Date: 2021年12月28日 上午11:14:41
 * History:
 */
package com.swak.frame.ump;

import com.swak.frame.dto.base.DTO;

public class EventInfo implements DTO {
    private static final long serialVersionUID = -4599440953677189998L;

    private String info;

    private String bizTag;

    private Object[] args;

    public EventInfo() {}

    public static EventInfo of(String info, String bizTag, Object[] args) {
        return new EventInfo(info, bizTag, args);
    }

    public static EventInfo of(String info, String bizTag) {
        return new EventInfo(info, bizTag, null);
    }

    public static EventInfo of(String info) {
        return new EventInfo(info, null, null);
    }

    public EventInfo(String info, String bizTag, Object[] args) {
        this.info = info;
        this.bizTag = bizTag;
        this.args = args;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getBizTag() {
        return bizTag;
    }

    public void setBizTag(String bizTag) {
        this.bizTag = bizTag;
    }

    public static class Builder {
        private String info;
        private String bizTag;
        private Object[] args;

        public Builder info(String info) {
            this.info = info;
            return this;
        }

        public Builder bizTag(String bizTag) {
            this.bizTag = bizTag;
            return this;
        }

        public Builder args(Object[] args) {
            this.args = args;
            return this;
        }

        public EventInfo build() {
            return new EventInfo(this);
        }
    }

    private EventInfo(Builder builder) {
        this.info = builder.info;
        this.bizTag = builder.bizTag;
        this.args = builder.args;
    }
}
